﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework
 * Version 2.10
 * 
 * CNR Data Parser Base Class
 *      Provides an abstract definition for protocol-specific data parser classes.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;

namespace Adaptive.Foundation.Network.Cnr
{
    /// <summary>
    /// Provides an abstract definition for protocol-specific data parser classes.
    /// </summary>
    public abstract class CnrDataParserBase
    {
        /// <summary>
        /// Parses the specified command string into a protocol-specific object graph.
        /// </summary>
        /// <param name="originalCommandString">
        /// The command string to be parsed.
        /// </param>
        /// <returns>
        /// A <see cref="CnrCommandBase"/> instance representing the text that was parsed.
        /// </returns>
        public abstract CnrCommandBase ParseProtocolCommandString(string originalCommandString);
        /// <summary>
        /// Parses the specified response string into a protocol-specific object graph.
        /// </summary>
        /// <param name="originalResponseString">
        /// The response string to be parsed.
        /// </param>
        /// <returns>
        /// A <see cref="CnrResponseBase"/> instance representing the text that was parsed.
        /// </returns>
        public abstract CnrResponseBase ParseProtocolResponseString(string originalResponseString);
        /// <summary>
        /// Parses the provided content into component parts based on a protocol-specific definition.
        /// </summary>
        /// <param name="originalDataString">The text content to be parsed.</param>
        /// <returns>
        /// A <see cref="String"/> array containing the protocol-specific component parts.
        /// </returns>
        public abstract string[] ParseProtocolDataIntoParts(string originalDataString);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="originalParameterData"></param>
        /// <returns></returns>
        public abstract string GetParameterName(string originalParameterData);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="originalParameterData"></param>
        /// <returns></returns>
        public abstract object GetParameterValue(string originalParameterData);
    }
}
